home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / macro28.lha / Macro / FinsGold / Modula / m2make.ged < prev    next >
Encoding:
Text File  |  1994-06-14  |  5.0 KB  |  191 lines

  1. /* m2make.ged $VER: 0.2 m2make.ged © 1994 Fin Schuppenhauer (13.06.94) */
  2.  
  3. OPTIONS RESULTS                             /* enable return codes     */
  4.  
  5. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  6.     address 'GOLDED.1'
  7.  
  8. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  9. OPTIONS FAILAT 6                            /* ignore warnings         */
  10. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  11.  
  12.  
  13. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  14.  
  15.  
  16. 'QUERY CAT'
  17. german = (result = "deutsch")
  18.  
  19. /* Dateinamen ermitteln: */
  20. 'QUERY FILE VAR FILENAME'
  21. if (right(filename, 4) ~= '.def') & (right(filename, 4) ~= '.mod') then do
  22.    if german then
  23.       'REQUEST BODY="Dies ist kein Modula-2-Quelltext!"'
  24.    else
  25.       'REQUEST BODY="This is no modula-2 source!"'
  26.    'UNLOCK'
  27.    EXIT
  28. end
  29.  
  30. /* Gibt es überhaupt etwas zu übersetzen ? */
  31. 'QUERY ANYTEXT'
  32. if result = 'FALSE' then do
  33.    if german then
  34.       'REQUEST BODY="Ähmm, kein Quelltext hier.|Trotzdem «Make» aufrufen ?" BUTTON=Ja|Nein'
  35.    else
  36.       'REQUEST BODY="There''s no source here.|Still start «make» ?" BUTTON=Yes|No'
  37.    if result= '0' then do
  38.       'UNLOCK'
  39.       EXIT
  40.    end
  41. end
  42.  
  43. /* Text verändert? Wenn ja, vorher sichern. */
  44. 'QUERY MODIFY'
  45. if result = 'TRUE' then
  46.    'SAVE ALL'
  47.  
  48.  
  49. filename = left(filename, length(filename)-4)
  50.  
  51. /* ------------ Aufruf-Argument überprüfen: ----------------- */
  52. PARSE ARG DPD
  53. if dpd = "create" then do
  54.    /* Abhängigkeiten erstellen: */
  55.    if german then
  56.       'REQUEST STATUS="Erstelle Abhängigkeitendatei 'filename'.dpd"'
  57.    else
  58.       'REQUEST STATUS="Creating dependencies file 'filename'.dpd"'
  59.    ADDRESS COMMAND 'M2:m2make -d 'filename
  60.    'REQUEST STATUS=""'
  61.    'UNLOCK'
  62.    EXIT
  63. end
  64.  
  65. /* --- Andernfalls soll übersetzt und gelinkt werden: -------- */
  66.  
  67.  
  68. /* Optionen für m2make ermitteln: */
  69. makeopt = "-"
  70. 'QUERY USER15'          /* x: in allen Verzeichnissen suchen ? */
  71. if result = 'FALSE' then
  72.    makeopt = makeopt || "x"
  73.  
  74. if makeopt = "-" then 
  75.    makeopt = ""
  76.  
  77.  
  78. /* Compiler-Optionen ermitteln: */
  79. compopt = "-"
  80. 'QUERY USER1'                 /* StackChk */
  81. if result='FALSE' then
  82.    compopt = compopt || "s"
  83. 'QUERY USER2'                 /* RangeChk */
  84. if result='FALSE' then
  85.    compopt = compopt || "r"
  86. 'QUERY USER3'                 /* OverflowChk */
  87. if result='FALSE' then
  88.    compopt = compopt || "v"
  89. 'QUERY USER4'                 /* NilChk */
  90. if result='FALSE' then
  91.    compopt = compopt || "n"
  92. 'QUERY USER5'                 /* EntryClear */
  93. if result='FALSE' then
  94.    compopt = compopt || "e"
  95. 'QUERY USER6'                 /* CaseChk */
  96. if result='FALSE' then
  97.    compopt = compopt || "c"
  98. 'QUERY USER7'                 /* ReturnChk */
  99. if result='FALSE' then
  100.    compopt = compopt || "f"
  101. 'QUERY USER8'                 /* LongAlign */
  102. if result='FALSE' then
  103.    compopt = compopt || "l"
  104. 'QUERY USER9'                 /* Volatile */
  105. if result='FALSE' then
  106.    compopt = compopt || "h"
  107. 'QUERY USER10'                 /* LargeVars */
  108. if result='FALSE' then
  109.    compopt = compopt || "y"
  110. 'QUERY USER11'                 /* StackParms */
  111. if result='FALSE' then
  112.    compopt = compopt || "z"
  113. /* Optimieren und/oder Debug-Informationen ? */
  114. 'QUERY USER12 VAR OPT'        /* Optimieren ? */
  115. 'QUERY USER13 VAR DBG'        /* Debug-Info ? */
  116. if (opt = 'TRUE') & (dbg = 'TRUE') then
  117.    optdbg = "+@"
  118. if (opt = 'TRUE') & (dbg = 'FALSE') then
  119.    optdbg = "-d"
  120. if (opt = 'FALSE') & (dbg = 'TRUE') then
  121.    optdbg = "+d"
  122. if (opt = 'FALSE') & (dbg = 'FALSE') then
  123.    optdbg = "-@"
  124.  
  125.  
  126. /* Linker-Optionen ermitteln: */
  127. /* Linke-Optionen ermitteln (sind (fast) alle per Default TRUE) */
  128. linkopt = "-"
  129. 'QUERY USER20'                 /* SmallCode */
  130. if result='FALSE' then
  131.    linkopt = linkopt || "c"
  132. 'QUERY USER19'                 /* SmallData */
  133. if result='FALSE' then
  134.    linkopt = linkopt || "d"
  135. 'QUERY USER16'                 /* DebugInfo */
  136. if result='FALSE' then
  137.    linkopt = linkopt || "x"
  138.  
  139. if linkopt = "-" then
  140.    linkopt = ""
  141. /* Minimalarts? Resident? */
  142. 'QUERY USER18'                 /* MinimalArts */
  143. if result='TRUE' then
  144.    linkopt = linkopt || "+m"
  145. 'QUERY USER17'                 /* Resident */
  146. if result='TRUE' then
  147.    linkopt = linkopt || "+r"
  148.  
  149.  
  150. /* Piktogramme erzeugen? */
  151. 'QUERY USER14'
  152. if result = 'TRUE' then
  153.    icons = "+i"
  154. else
  155.    icons = "-i"
  156.  
  157.  
  158. if german then
  159.    'REQUEST STATUS="Starte «Make» mit 'filename' ..."'
  160. else
  161.    'REQUEST STATUS="Starting «make» with 'filename' ..."'
  162.  
  163.  
  164. OPTIONS FAILAT 15
  165. ADDRESS COMMAND 'M2:m2make +d'makeopt || icons '-c'compopt || optdbg' -o'linkopt' 'filename
  166.  
  167. 'REQUEST STATUS=""'
  168. if rc = 0 then
  169.    if german then
  170.       'REQUEST BODY="Makelauf war erfolgreich." BUTTON="Sehr schön"'
  171.    else
  172.       'REQUEST BODY="Successfull make." BUTTON="Nice"'
  173. else
  174.    if german then
  175.       'REQUEST BODY="Irrgs! Da ging wohl was schief..." BUTTON="Mist!"'
  176.    else
  177.       'REQUEST BODY="Urrgh! Something went wrong..." BUTOON="Damned!"'
  178.  
  179.  
  180. /* ---------------------------- END OF YOUR CODE --------------------- */
  181.  
  182. 'UNLOCK' /* VERY important: unlock GUI */
  183. EXIT
  184.  
  185. SYNTAX:
  186.  
  187. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  188. 'UNLOCK'
  189. EXIT
  190.  
  191.